﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Properties;
using System.Data;
using System.Data.SqlClient;

namespace IngressApp.DAC
{
    public class DACDelete
    {
        DBInfo Info = new DBInfo();

        public bool deleteEmpleado(int idEmpleado)
        {
            SqlConnection con = new SqlConnection(Info.sqlSet());
            SqlCommand cmd = new SqlCommand("SP_Empleado_DeleteRow",con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@IdEmpleado", SqlDbType.Int).Value = idEmpleado;

            con.Open();

            if (cmd.ExecuteNonQuery() > 0)
                return true;
            else
                return false;

        }
        public bool deleteEmpleadoHuella(int idEmpleadoHuella)
        {
            SqlConnection con = new SqlConnection(Info.sqlSet());
            SqlCommand cmd = new SqlCommand("SP_EmpleadoHuella_DeleteRow", con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@IdEmpleadoHuella", SqlDbType.Int).Value = idEmpleadoHuella;

            con.Open();

            if (cmd.ExecuteNonQuery() > 0)
                return true;
            else
                return false;

        }
        public bool deleteTipoHuella(int idTipoHuella)
        {
            SqlConnection con = new SqlConnection(Info.sqlSet());
            SqlCommand cmd = new SqlCommand("SP_TipoHuella_DeleteRow", con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@idTipoHuella", SqlDbType.Int).Value = idTipoHuella;

            con.Open();

            if (cmd.ExecuteNonQuery() > 0)
                return true;
            else
                return false;

        }
        public bool deleteRegistro(int idRegistro)
        {
            SqlConnection con = new SqlConnection(Info.sqlSet());
            SqlCommand cmd = new SqlCommand("SP_Registro_DeleteRow", con);
            cmd.CommandType = CommandType.StoredProcedure;

            cmd.Parameters.Add("@idRegistro", SqlDbType.Int).Value = idRegistro;

            con.Open();

            if (cmd.ExecuteNonQuery() > 0)
                return true;
            else
                return false;

        }

    }
}
